<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>中国福利彩票</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">

<!--页面样式-->
<link rel="stylesheet" type="text/css" href="css/style.css" />

<script src="js/jquery-1.7.2.min.js"></script>

<!--两个省级联动-->
<!-- <script language="javascript" src="js/PCASClass.js"></script> -->


</head>
<body  style="width:10rem !important; margin:0 auto">
<script>
/*取设备宽度*/
	function rem(){
	var iWidth=document.documentElement.getBoundingClientRect().width;
	iWidth=iWidth>640?640:iWidth;
	document.getElementsByTagName("html")[0].style.fontSize=iWidth/10+"px";
	};
	rem();
	window.onorientationchange=window.onresize=rem      
</script>

<div class="Header">
<!--     	<div style="float:left;" class="left H_logot"><a href="MemberCenter.html"><img src="images/logo.png"></a></div> -->
        <div style="float:left;width:5rem;margin-left:1.4rem" class="left H_content text-center font28 cfffff">完善个人信息</div>
        <div class="right H_right text-right font24"><a href="MemberCenter.html"><img src="images/Nimg4.png"></a></div>
        <div class="clear"></div>
    </div>
    
    <div class="Forgetpwd">
    	
        <div class="font28 c666666 RG3_big">
        	<table width="100%" border="0" cellspacing="0" cellpadding="0">
				<tr>
					<td width="20%" align="right">邮箱：</td>
					<td width="80%"><input style="display: block;border: none;height: 1.20625rem;outline:none;width:6.53125rem;border-radius: 0.15625rem;border: 1px solid #e9e9e9;" type="text" class="RE1_t3 c666666" id="email" />
					</td>
				</tr>
				<tr>
                <td align="right">职业：</td>
                <td>
                	<div class="RG3">
                    	<select style="width:7.5rem" name="" class="font28 c999999 Weiruan" id="job">
                    	  	    <option value="1">专业技术人员（律师，工程师等）</option>
								<option value="2">政府公务员或事业单位编制人员</option>
								<option value="3">个体户/私营老板</option>
								<option value="4">企业中高层管理人员</option>
								<option value="5">企业办公室职员</option>
								<option value="6">工人，服务人员等</option>
								<option value="7">自由职业者</option>
								<option value="8">其他</option>
						</select>
                    </div>
                </td>
              </tr>
              <tr>
                <td align="right">月收入：</td>
                <td>
                	<div class="RG3">
                    	<select name="" class="font28 c999999 Weiruan" id="monthincome">
	                    	  <option value="1">1000元以下</option>
	                    	  <option value="2">1000-3000元</option>
	                    	  <option value="3">3000-5000元</option>
	                    	  <option value="4">5000-10000元</option>
	                    	  <option value="5">10000-20000元</option>
	                    	  <option value="6">20000元以上</option>
                    	</select>
                    </div>
                </td>
              </tr>
              <tr>
                <td align="right">学历：</td>
                <td>
                	<div class="RG3_two">
                    	<select style="width:6rem" name="" class="font28 c999999 Weiruan" id="education">
                    	   <option value="1">高中/中专/中技及以下</option>
                    	   <option value="2">大专及同等学历</option>
                    	   <option value="3">本科/学士及同等学历</option>
                    	   <option value="4">硕士/研究生及同等学历</option>
                    	   <option value="5">博士及以上</option>
                    	</select>
                    </div>
                </td>
              </tr>
              <tr>
                <td align="right" valign="top">地址：</td>
                <td>
                	<div class="SB_city" style="width:7rem;margin-bottom:1.6rem">
					<div>
                		<select style="float:left;" name="province"class="font28 c999999 Weiruan" id="province"></select>
                		<select style="float:right;" name="city" class="font28 c999999 Weiruan" id="city"></select>
					</div>
                	</div>
<!-- 					<input style="height:1.2rem;border-radius: 0.15625rem;border: 1px solid #e9e9e9;width:7.0rem" type="text" placeholder="请输入具体街道" class="DT_text font28 Weiruan c666666" id="address" name="address"> -->
					<textarea style="width:7rem;resize:none;border-radius: 0.15625rem;border: 1px solid #e9e9e9;" id="address" name="address" clos="40" rows="5" placeholder="请输入具体街道"></textarea>
                </td>
              </tr>
              <tr>
                <td colspan="2">
                	<input type="submit" value="上传身份证正面" class="FPWD_but2 font32 c333333 Weiruan" onclick="selPic('idCardPhotoFront')"/>
                	<div class="RE_c" style="display: none;" id="idCardPhotoFrontDiv">
                       <a href="#" >
                            <img src="" width="96" id="idCardPhotoFront"/>
                        </a>
                    </div>
                </td>
              </tr>
              <tr>
                <td colspan="2">
                	<input type="submit" value="上传身份证背面" class="FPWD_but2 font32 c333333 Weiruan" onclick="selPic('idCardPhotoBehind')"/>
                	<div class="RE_c" style="display: none;" id="idCardPhotoBehindDiv">
                        <a href="#"  >
                           	<img src="" width="96" id="idCardPhotoBehind"/>
                        </a>
                    </div>
                </td>
                <td style="display: none;">
                            <input type="file" name="file" id="docFront" style="width:150px;" onchange="setImagePreview('','docFront','idCardPhotoFront')">
                            <input type="file" name="file" id="docBehind" style="width:150px;" onchange="setImagePreview('','docBehind','idCardPhotoBehind')">
                           	<input type="text"  id="idCardPhotoFrontCode"/>
                           	<input type="text"  id="idCardPhotoBehindCode"/>
                            </td>
              </tr>
              <tr>
                <td colspan="2">
                	<input type="submit" value="完 成" class="FPWD_but font32 cfffff Weiruan marginT60"  onclick="nextStep()" />
                </td>
              </tr>
            </table>
        </div>
        
    </div>
<!-- 弹出alert -->
	<div class="falert" style="display: none;" id="warnInfoDiv">

		<div class="falert_t font30">
			<span style="margin-left: 0.15rem">提示</span>
		</div>
		<div class="falert_b">
			<span id="warnInfo"></span><img class="dianji_gb"
				style="position: absolute; right: 0.1rem; top: 0.15rem; cursor: pointer;"
				width="45rem" src="images/Fimg8.png"
				onclick="closeWarnInfoDiv('warnInfoDiv')" />
		</div>
	</div>
	<!-- 弹出alert -->
</body>
<script type="text/javascript">
	var accountId="";
	var token="";
	var channelId="";
    jQuery(document).ready(function($){
    	accountId = getCookie("accountId");
    	token =  getCookie("token");
    	channelId = getCookie("channelId");
    	//调用地区参数查询接口
    	getFirstLevel();
    	getSecondLevel($('#province').val());
    	
    	//归属地第一级改变出发的事件
    	$("#province").change(function(){
    		getSecondLevel($('#province').val());
    		});
    });
    function selPic(id){
    	if(id=='idCardPhotoBehind'){
    		document.getElementById("docBehind").click();
    		 $('#idCardPhotoBehindDiv').show();
    	}else{ 
    		document.getElementById("docFront").click();
    		$('#idCardPhotoFrontDiv').show();
    	}
    	
    }
    //点击完成
    function nextStep(){
    	 //验证邮箱
    	if(!validateEmail('email')){
    		return;
    	}
    	 //验证身份证
    	if(!validateIdPhoto('idCardPhotoFrontCode','idCardPhotoBehindCode')){
    		return;
    	}
    	  var para = {
    			  	accountId:accountId,
					token:token,
					email:$('#email').val(),
    				job:$('#job').val(),
    				monthincome:$('#monthincome').val(),
    				education:$('#education').val(),
    				address:$('#province').val()+"_"+$('#city').val()+"_"+$('#address').val(),
    				idCardPhotoFront:$('#idCardPhotoFrontCode').val(),
    				idCardPhotoBehind:$('#idCardPhotoBehindCode').val(),
    				channelId:channelId
    	        };
    		
    		$.ajax({
    			url : "../../api/accountSystem/register/complement",
    			async:false,
    			type : "POST",
    			herder:{
    				'Accept':'application/json',
    				'Content-Type':'application/json'
    			},
    			dataType:"json",
    			contentType:"application/json",
    			data: JSON.stringify(para),
    			error:function(XMLHttpRequest, textStatus, errorThrown){
    				alert(errorThrown);
    			},
    			success: function(data, textStatus){
    				if(data.success == true){
    					window.location.href='Register3Win.html';
    				}else{
    					alert(data.description);
    					return;
    				}
    			}		
    		});
    }
  //获得归属地--第一级
    function getFirstLevel(){
    	$.ajax({
    		url : "../../api/accountSystem/para/region?pid=0",
    		async:false,
    		type : "GET",
    		herder:{
    			'Accept':'application/json',
    			'Content-Type':'application/json'
    		},
    		dataType:"json",
    		contentType:"application/json",
    		error:function(XMLHttpRequest, textStatus, errorThrown){
    			alert(errorThrown);
    		},
    		success: function(data, textStatus){
    			document.getElementById("province").options.length=0;
//     			var obj = eval("("+data+")"); 
    			for(var i=0;i<data.length;i++){
    				document.getElementById("province").options.add(new Option(data[i].regionName,data[i].id));
    			}
    		}		
    	});
    }
    //获得归属地--第二级
    function getSecondLevel(pid){
    	if(pid==null){
    		pid=0;
    	}
    	$.ajax({
    		url : "../../api/accountSystem/para/region?pid="+pid+"",
    		async:false,
    		type : "GET",
    		herder:{
    			'Accept':'application/json',
    			'Content-Type':'application/json'
    		},
    		dataType:"json",
    		contentType:"application/json",
    		error:function(XMLHttpRequest, textStatus, errorThrown){
    			alert(errorThrown);
    		},
    		success: function(data, textStatus){
    			document.getElementById("city").options.length=0;
//     			var obj = eval("("+data+")"); 
    			for(var i=0;i<data.length;i++){
    				document.getElementById("city").options.add(new Option(data[i].regionName,data[i].id));
    			}
    		}		
    	});
    }
</script>
<!-- <script language="javascript" defer> 
	new PCAS("province","city","area","北京市","北京市","北京市");
 </script> -->
<script src="js/common.js"></script>
<script src="js/jsCallCookies.js"></script>
<script src="js/validation.js"></script>
</html>
